<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>图片列表</title>
<link rel="stylesheet" type="text/css" href="template/admin.css"/>
<script type="text/javascript" src="template/images/jquery.js"></script>
<style type="text/css">
body{margin:20px;}
</style>
<script type="text/javascript">
$(document).ready(function(){
	$('#show_list').find('tr').hover(function(){
		$(this).find('td').css('background','#ccffcc');
	},function(){
		$(this).find('td').css('background','');
	});
	
});
</script>
</head>

<body>
<div class="div_out">
 <div class="position"><h2>当前位置 > <a href="?">图片列表</a> > <?php echo $path;?></h2></div>
</div><!--导航-->


 

<div id="sys">

<div class="div_out" id="tb">
 <table cellpadding="0" cellspacing="0" width="100%">
 	<thead>
		<tr><th style="width:15%">图片</th><th style="width:30%">图片alt</th><th style="width:20%">上传时间</th><th style="width:5%">缩略图</th><th style="width:10%">格式</th><th style="width:20%">操作</th></tr>
	</thead>
	<tbody id="show_list">
	<?php
	if(!empty($rel)){
	foreach($rel as $k=>$v){
	$pic=$v['pic_path'].$v['pic_name'].'.'.$v['pic_ext'];
	$img=CMS_SELF.$pic;
	?>
	<tr><td style="width:15%;text-align:center" align="center"><a href="<?php echo $img;?>" target="_blank"><img src="<?php echo $img;?>" width="50" height="50" border="0" /></a></td><td style="width:25%;text-align:center" align="center"><?php echo $v['pic_alt'];?></td><td scope="width:20%;text-align:center" align="center"><?php echo date('Y-m-d H:m:s',$v['pic_time']);?></td><td style="width:5%; text-align:center"><?php echo ($v['pic_thumb'])?'有':'<span style="color:red">无</span>';?></td><td style="width:10%; text-align:center"><?php echo $v['pic_ext'];?></td><td style="width:20%;text-align:center" align="center"><a href="javascript:if(confirm('确定要删除么？删除后不可恢复')){location.href='admin_pic.php?action=del&id=<?php echo $v['id'];?>';}">删除</a>|<a href="?action=edit_pic&id=<?php echo $v['id'];?>">修改</a></td></tr>
	<?php
	}
	}
	?>

		
		</tbody>
 </table>
 </div>

</div><!--内容切换-->

<div class="page">
 	<ul>
		<?php echo page('admin_pic.php',$page,$query,$total_num,$total_page);?>
	</ul>
 </div>

<?php
if($step=='new_dir'){
?>
<p style="line-height:25px;">新建的文件夹将会放在<span style="color:red"><?php echo $path;?></span>目录下</p>
<form name="maininfo" method="post" enctype="multipart/form-data" action="?" class="form" style="margin-top:5px;">
<div class="div_out" id="tb">
 <table cellpadding="0" cellspacing="0" width="100%">
 	<thead>
		<tr><th class="w1">参数说明</th><th class="w2">参数值</th><th class="w3">说明</th></tr>
	</thead>
	<tbody>	
		<tr>
		  <td class="w1">目录名称:</td><td class="w2"><input name="dir_name"  value="" style="width:50%"/></td><td class="w3">只能使用英文和数字,创建后不可更改</td>
		</tr>
	</tbody>
 </table>
 </div>
 <div class="btn" style="margin-top:10px">
<input type="hidden" name="action" value="creat_dir"/><input type="hidden" name="path" value="<?php echo $path;?>" />
  <input type="submit" value="确定" class="go" name="submit"/><input type="reset" style="margin:0 10px;" class="go" value="重置" name="reset"/>
 </div>
</form>
<?php }

if($step=='up'){
?>
<p style="line-height:25px;">新上传的文件将会放在<span style="color:red"><?php echo $path;?></span>目录下</p>
<form name="maininfo" method="post" enctype="multipart/form-data" action="?" class="form" style="margin-top:5px;">
<div class="div_out" id="tb">
 <table cellpadding="0" cellspacing="0" width="100%">
 	<thead>
		<tr><th class="w1">参数说明</th><th class="w2">参数值</th></tr>
	</thead>
	<tbody>	
		<tr>
		  <td class="w1">上传文件:</td><td class="w2"><input type="file" name="up" />文件名称(为空将使用默认,不能重复):<input name="name" value="" /></td>
		</tr>
	</tbody>
 </table>
 </div>
 <div class="btn" style="margin-top:10px">
<input type="hidden" name="action" value="up_load"/><input type="hidden" name="path" value="<?php echo $path;?>" />
  <input type="submit" value="上传" class="go" name="submit"/><input type="reset" style="margin:0 10px;" class="go" value="重置" name="reset"/>
 </div>
</form>
<?php }?>

<?php
if($step=='copy'){
?>
<form name="maininfo" method="post" enctype="multipart/form-data" action="?" class="form" style="margin-top:5px;">
<div class="div_out" id="tb">
 <table cellpadding="0" cellspacing="0" width="100%">
 	<thead>
		<tr><th class="w1">参数说明</th><th class="w2">参数值</th><th class="w3">说明</th></tr>
	</thead>
	<tbody>	
		<tr>
		  <td class="w1">新位置:</td><td class="w2"><select name="dir_to">
		  <?php dir_list('upload');?>
		  </select></td><td class="w3">只能使用英文和数字,创建后不可更改</td>
		</tr>
		<tr>
		  <td class="w1">当前位置:</td><td class="w2"><?php echo $path.'/'.$file_from;?></td><td class="w3"></td>
		</tr>
	</tbody>
 </table>
 </div>
 <div class="btn" style="margin-top:10px">
<input type="hidden" name="action" value="copy_dir"/><input type="hidden" name="dir_from" value="<?php echo $path.'/'.$file_from;?>" />
  <input type="submit" value="确定" class="go" name="submit"/><input type="reset" style="margin:0 10px;" class="go" value="重置" name="reset"/>
 </div>
</form>
<?php }
?>
</body>
</html>
